<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%@ include file="/common/grid/jqGrid.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="">
	<meta http-equiv="description" content="">
	
  </head>
  
  <body>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		<jsp:include page="/jsp/outward/business/common/menuLink.jsp">
    			<jsp:param name="menuLink" value="[{'name':'表单模块管理'}]"/>
    			<jsp:param name="width" value="40%"/>
    		</jsp:include>
    		
			<table cellspacing="0" width="100%">
				<tr>
					<td align="left">
    					<input type="button" value="新增" class="btn" onclick="addFormModule()" />
    				</td>
    			</tr>
    		</table>
    		
    		<table id="listGrid" cellpadding="3" cellspacing="0"></table>
			<div id="pager" style="text-align:center;"></div>
    	</s:form>
    
    <script type="text/javascript">
    $(function(){
		loadGridData('listGrid', 'pager', 'frm');
	});
	
    function searchThis()
    {
    	toSearchList('listGrid', 'frm');
    }

    function addFormModule()
    {
        var url = realPath + '/inner/core/toSaveFormModule.action';
        openWin(url, 500, 200);
    }

    function toSaveFormModule(id)
    {
        var url = realPath + '/inner/core/toSaveFormModule.action?fm.id=' + id;
        openWin(url, 500, 200);
    }

    function delFormModule(id)
    {
    	showConfirm('确认删除？', function(v){
        	if(v == true)
        	{
        		var url = 'inner/core/delFormModule.action?fm.id=' + id;
        		ajaxAction(url, 'get', 'frm', true, function(result){
            		var obj = eval(result);
            		if('success' == obj.result)
            		{
		    			searchThis();
            		}
            		else
            		{
						showMsg(obj.message);
                	}
		    	});
        	}
    	});
    }

    function formDefineManage(id)
    {
		var url = realPath + '/inner/core/formDefineManage.action?fvo.moduleId=' + id + '&lvvo.listCode=form_formDefine';
		window.location.href = url;
    }
    </script>
  </body>
</html>
